<template>
  <div class="leaveword">
    <h3 class="title">留言标题</h3>
    <p class="subtitle">
      <span>发表时间:&nbsp;{{leaveWord.createTime | dateFormat()}}</span>
      <span>赞(125)</span>
    </p>
    <hr/>
    <div class="content">{{leaveWord.word}}</div>
    <img :src="leaveWord.imgSrc" alt="" width="100%"/>
  </div>

</template>

<script>
  export default {
    name: "leave_word_info",
    data(){
      return {
        id:this.$route.params.id,
        leaveWord:{},
      }
    },
    methods:{
      getLeaceWord(){
        // TODO 根据留言id后台查询留言实体
        /*this.$http.get("").then(res=> {
          this.leaveWord = res.body;
        })*/
        this.leaveWord = {
          id: this.id,
            username: '小' + this.id,
          createTime: new Date,
          imgSrc: '/static/images/shuijiao.jpg',
          word: '今天吃了饭.'
        };
      },
    },
    created(){
      this.getLeaceWord();
    }
  }
</script>

<style lang="scss" scoped>
  .leaveword {
    padding: 0 4px;
    .title{
      font-size: 22px;
      text-align: center;
      margin: 15px 0;
      color: #000;
      line-height: 1.45;
      font-weight: 600;
    }
    .subtitle {
      font-size: 13px;
      color: #8f8f94;
      display: flex;
      justify-content: space-between;
    }
    .content {
      margin: 4px 0px;

    }

  }
</style>
